	    //加载控制台数据
	function loadConsoledata(){
        var url = '';//学生
	       	if( $api.getStorage('cfnetSelectType') ==1){//老师
//	       		url = url_toDoMessageList
	       	}else if( $api.getStorage('cfnetSelectType') ==2){
//	       		url = url_getMasterNoList
	       	}
	    	var params = {
	      		uid :$api.getStorage('cfnetppuid'),
	      		jid : jid
	    	};
		    cfnetppPOST(url,params,true,function(data, status){
		           	api.hideProgress();
		      	if (status == 'success') {
		        	if (data.code==200) {
		        	  consoleData = data.data;
		        	 }
		        	
		        	}
		    })
	 }
//打开课程
function courseWin() {
	if (type == 1) {//老师
		openwin(5);
	} else {
		openwin(1);
	}
}
//课程的html
 function courseHtml(){
		 var courseHtmlString = new String();
		 var courseDatas = consoleData.learndata;
		  if (type == 1) {//老师
			for (var i = 0; i < courseDatas.length; i++) {
			  if(courseData.usertype == 1){//老师
				courseHtmlString += courseHtmlWithData(courseData, i);
				}else{//学生
			        courseHtmlString += studyCourseHtmlWithData(courseData, i);
				}
			}
			}else{
				courseHtmlString += studyCourseHtmlWithData(courseData, i);
			}
		$("#courseViewId").html(trainHtmls);
     }
function studyCourseHtmlWithData(courseData, index){
//			var timeTitleHtml = timeTitleWithEndTime(courseData.etime);
	var imageUrl = courseData.coverimages;
	var title = courseData.coursename;
	var schedule = "0";//进度
	var str = courseData.cjd;
	if (str == 'undefined' || str == '' || str == undefined) {
		str = '0';
	}
	if (str.indexOf("%") > 0) {
		var sarr = str.split('%');
		schedule = sarr[0];
	} else {
		schedule = courseData.cjd;
	}
	var courseJinDu = "";
	if (courseData.coursetype == 2108) {
		var videosum = parseInt(numNullStr(courseData.videosum));
		var videosums = parseInt(numNullStr(courseData.videosums));
		if (videosum > videosums) {
			videosum = videosums;
		}
		courseJinDu = '<p class="mui-ellipsis subtitle small-title bottom-p"><span class="left-span">自由课程</span><span class="right-span">已学习<span id="freeStudied'+courseData.courseid+'" class="course_schedule subtitle-red">'+videosum+'</span>/<span id="freeAllChapter'+courseData.courseid+'">'+videosums+'</span></span></p>';
	}else if(courseData.coursetype == 2109){
	 	courseJinDu = '<p class="mui-ellipsis subtitle small-title bottom-p"><span class="left-span">MOOC课程</span><span class="right-span">已学习 <span class="course_schedule subtitle-red">'+schedule+'%</span></span></p>';
	}else{
		courseJinDu = '<p class="mui-ellipsis subtitle small-title bottom-p">已学习 <span class="course_schedule subtitle-red">'+schedule+'%</span></p>';
	}
	return '<li  class="mui-table-view-cell mui-media weui_media_appmsg" onclick="setCoursetWindow('+index+')" >'+
			'<a href="javascript:;">'+
//						timeTitleHtml+
				'<img class="mui-media-object mui-pull-left course-img" src="'+imageUrl+'">'+
				'<div class="mui-media-body top-content">'+
					'<p class="course_title">'+
						title+
					'</p>'+
				'</div>'+
				'<div class="mui-media-body bottom-content">'+
					'<div class="">'+
						'<p class="mui-ellipsis subtitle top-p">授课老师：'+courseData.speaker+'</p>'+
						courseJinDu+
					'</div>'+
				'</div>'+
			'</a>'+
		'</li>';
		}
function courseHtmlWithData(data, index){
//			var timeTitleHtml = timeTitleWithEndTime(data.etime);
	var cyArr = data.cydata;

	var cellLeftContentClass = '';	
	var courseChapterString = '共'+numNullStr(data.chapternum)+'课时';
	var iconName = 'keshi';
	if (data.coursetype == '2108') {//自由课程
		courseChapterString = '共'+numNullStr(data.chapternum)+'章';
		iconName = 'zhangjie';
	}
	var examid = data.examid;
	var examBtn = '';
	var leftDivClass = '';
	if (examid != undefined && examid != null && examid != '' && examid != '0') {
		examBtn = '<div class="right-content">'+
				'<button index="' + index + '" type="button" class="mui-btn cell-btn cell-right-btn">批卷</button>'+
			'</div>';
		leftDivClass = 'left-content';	
	}
	var typeTagHtml = '<p class="course-type-tag">授课</p>';
	return '<li index="' + index + '" class="mui-table-view-cell mui-media" onclick="setCoursetWindow('+index+')" >'+
		'<a href="javascript:;">'+
//					timeTitleHtml+
			typeTagHtml+
			'<img class="mui-media-object mui-pull-left course-img" src="' + data.coverimages + '"/>'+
			'<div class="mui-media-body top-content">'+
				'<p class="course_title">' + data.coursename + '</p>'+
			'</div>'+
			'<div class="mui-media-body bottom-content">'+
				'<div class="top-p">'+
					'<p class="mui-ellipsis subtitle">'+
						'<span class="left-span"><img class="tag-img" src="../../image/icon_'+iconName+'.png">'+courseChapterString+'</span>'+
					'</p>'+
				'</div>'+
				'<div class="bottom-p">'+
					'<div>'+
						'<p class="mui-ellipsis subtitle">'+
							'<span class="left-span"><img class="tag-img" src="../../image/icon_ren.png">'+numNullStr(data.countnum)+'人</span>'+
							'<span class="info-span"><img class="tag-img" src="../../image/icon_shijian.png">'+minuteWithSecond(numNullStr(data.timenum))+'分</span>'+
						'</p>'+
					'</div>'+
				'</div>'+
			'</div>'+
		'</a>'+
	'</li>';
}
		//学生实习html
 function StuinternshipHtml(){
 var data = consoleData.internshipdata;
 var examdata = data.examdata;
 var  internshipHtml = "" +examHtmlWithData(examdata);
  $("#studInternshipId").html(internshipHtml);
 }
 //学生实习考试
function examHtmlWithData(data){
   return '<li class="mui-table-view-cell mui-media " onclick="internshipdata()">'+
				'<a href="javascript:;" class="li-padding-10">'+
					'<img class="mui-media-object mui-pull-left course-img" src="' + data.coverimages + '"/>'+
					'<div class="mui-media-body top-content">'+
						'<p class="course_title">'+data.title+'</p>'+
					'</div>'+
						'<div class="bottom-p-internship ">'+
							'<div class="content-internship">'+
								'<button type="button" class="mui-btn cell-btn-internship ">'
									+'进入考试'+
								'</button>'+
							'</div>'+
							
						'</div>'+
				'</a>'+
			  '</li>';
}
		//老师实习html
 function TecinternshipHtml(){
 var data = consoleData.internshipdata;

 }
 

//培训
function trainHtml() {
	var trainHtmls = '<li class="mui-table-view-cell mui-media train-cell" onclick=openWinOnclick(' + 5 + ')>'
					 + '<div class="train-cell-content-div">' +
					  '<img class="train-top-image" src="' + data[i].image + '">'
					   + '<p class="train-top-title">' + data.title + '</p>' +
					    '</div>' + '<div class="train-cell-bottom-div">' 
					    + '<p class="train-bottom-left-title base_dark_grey_shallow base_tag_font">'
					     + '培训时间:' + timePointStringWithTimeStamp(data.begintime.toString()) + '-' + timePointStringWithTimeStamp(data.stoptime.toString()) + '</p>' 
					     + '<span class="base_dark_grey_shallow base_tag_font">' + '培训地点:' + data.place + '</span>' 
					     + '</div>' + '</li>';
	$("#trainViewId").html(trainHtmls);
}
//竞赛
function competitionHtml(){
  var data = consoleData.competitiondata;
  $("#competitionImageId").src(data.image);
  $("#competitionNameId").html(data.title);
//$("#competitionNumId").html();	
//$("#competitionPmId").html();
//$("#competitionJfId").html();	
}

//打开相关页面
function openWinOnclick(type) {
	if(type == 3){//认证
	  name = 'CertificationForm.html',
	  name = 'CertificationForm.html',
	  pageParam = {
	         type :1,
			sourceurl : window.location.pathname,
			sourcetitle : document.title,
		};
	}else if (type == 4) {//老师端实习
		name = 'TeachertInternshipIndex';
		url = 'InternshipIndex.html';
		pageParam = {
			sourceurl : window.location.pathname,
			sourcetitle : document.title,
			type : 1,
		};
		$api.setStorage('changfengtype', 2);
		//区别老师点击的实习的集团类型
	} else if (type == 6) {//培训
		var data = consoleData.traindata;
		winName = "Teacher_TrainSignUp";
		winPath = "./html/Teacher_Teach/Teacher_TrainSignUp.html";
		var url1 = data.detail;
		if (url1 != '' && url1 != null && url1 != undefined) {
			if (url1.indexOf("http") == -1) {//包含
				return;
			}
			pageParam = {
				signUpStatus : 0, //报名状态 0未报名 1 已报名 2已结束
				signUpedUrl : url1, //跟signUpUrl参数一致 为什么这么传忘了
				lastPageUrl : window.location.pathname, //当前页面的路径 如：“widget://html/Teacher_Teach/Teacher_TrainDetail.html”
				lastPageName : document.title, //当前页面的名称 如“培训详情win”
				signUpUrl : isfreelogin(data.islogin, url1),
				cname : data.title //培训名称
			}
		};
	} else if (type == 5) {//竞赛
		var data = consoleData.competitiondata;
		winName = "indexLunDetailsWindow";
		winPath = "./html/HomePage/indexLunDetailsWindow.html";
		var url1 = data.detail;
		if (url1 != '' && url1 != null && url1 != undefined) {
			if (url1.indexOf("http") == -1) {//包含
				return;
			}
			var pageParam = {
				url : isfreelogin(data.islogin, url1),
				title : data.cname,
				sourceurl : window.location.pathname,
				sourcetitle : document.title,
				ctitle : '竞赛',
				Newstype : '',
				shareurl : url1
			}

		}
	}
	api.openWin({useWKWebView:true,
		name : winName,
		url : winPath,
		pageParam : pageParam
	});

}
	function setCoursetWindow(i){
		 var courseDatas = consoleData.learndata;
		 var data =  courseDatas[i];
		data["title"] = data.coursename;
		data["imgurl"] = data.coverimages;
		data["selected"] = 1;
		data["userType"] = data.usertype;
			if (data.coursetype == 2108) {//自由课程
				openFree(data);
			}else if(data.coursetype == 2109){//慕课
				openMooc(data);
			}else{
				api.toast({
				    msg: '暂不支持该课程类型'
				});
			}
			
		}
			//打开mooc课程
	function openMooc(data){
	   	data["sourceurl"]=api.pageParam.sourceurl;
	   	data["sourcetitle"]=api.pageParam.sourcetitle;
   		api.openWin({useWKWebView:true,
		    name: 'Teacher_StudyCourseInfo',
		    url: '../Teacher_Teach/Teacher_StudyCourseInfo.html',
		    pageParam: data
		});
			
	}
	//打开自由课程
	function openFree(data){
	   	data["sourceurl"]=api.pageParam.sourceurl;
	   	data["sourcetitle"]=api.pageParam.sourcetitle;
	   	if (data.usertype == 1) {//老师
	   		api.openWin({useWKWebView:true,
			    name: 'Teacher_StudyFreeCourseTab',
			    url: '../Teacher_Teach/Teacher_StudyFreeCourseTab.html',
			    pageParam: data,
	   		    slidBackEnabled: false
			});
		}else{
			api.openWin({useWKWebView:true,
			    name: 'Student_FreeCourseTab',
			    url: '../Study/Student_FreeCourseTab.html',
			    pageParam: data
			});
		}

	}
	//实习课程跳转
   function setInternshipCoursetWindow(id){
   	var data =consoleData.internshipdata;
   	data["userType"]= 'student',
   	data["sourceurl"]=api.pageParam.sourceurl;
	data["sourcetitle"]=api.pageParam.sourcetitle;
	 if (coursetype == 2108) {//自由课程
			pageName = 'Student_trainFreeCourseTab';
			pageUrl = 'Student_trainFreeCourseTab.html';
		} else if (coursetype == 2109) {//慕课
			pageName = 'Student_trainCourseMoocTab';
			pageUrl = '../Study/Student_trainCourseMoocTab.html';
		}
		api.openWin({useWKWebView:true,
			    name: pageName,
			    url: pageUrl,
			    pageParam: data
		});
   }
  	/*
  	 *实习相关页面跳转
  	 */
   function opneInternshipwin(type){
   var data  = new Array();;
// 	data["sourceurl"]=api.pageParam.sourceurl;
//	data["sourcetitle"]=api.pageParam.sourcetitle;
	var pageName= '';
	var  url = '';
     if(type == 1){//学生提交签到
         pageName ='Student_dailyCheckWindow';
		 url= 'html/TrainReport/Student_dailyCheckWindow.html';
    } else if(type == 2){//学生提交报告
     	pageName = 'Practice_StudentReport_Win';
		url = 'html/Practice_Student/Practice_StudentReport_Win.html';
     }
     else if(type == 3){//学生查看成成绩
       	pageName = 'PositionDetailsWind.html';
		url = 'html/Practice_Student/PositionDetailsWind.html';
//	   data = {
//			id : students[i].id,
//			gwid : students[i].gwid,
//			type : type,
//			title : students[i].titles,
//			uid : api.pageParam.uid,
//			sourceurl : window.location.pathname,
//			sourcetitle : document.title,
//			open_type : 1
//			}
      }else if(type == 4){//老师查看签到、
       pageName = 'Teacher_checkSignWindow';
	   url = 'html/Manage/Teacher_checkSignWindow.html';
      }else if(type == 5){//老师查看报告
       pageName = 'Practice_TeacherReportWindow';
	   url = 'html/Practice_Teacher/Practice_TeacherReportWindow.html';
     }else if(type == 6){//老师管理学生
        pageName = 'ManagementViewWind';
	    url = 'html/Practice_Teacher/ManagementViewWind.html';
     }
     api.openWin({useWKWebView:true,
			    name: pageName,
			    url: url,
			    pageParam: data
		});
   }
		